home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ddj1291.zip / STAT.ZIP / SOURCE.ZIP / PAWHERE.C < prev   
C/C++ Source or Header  |  1990-05-09  |  780b  |  31 lines

  1. /*
  2. ** File:    pawhere.c
  3. **
  4. **        Copyright 1990
  5. **        Fred Motteler and Applied Microsystems Corporation
  6. **        All Rights Reserved
  7. **
  8. ** Description:    This file contains a very simple program that returns its
  9. **        segment base address.  Note that this program is Lattice
  10. **        version 6.01 specific in that the Lattice small model
  11. **        has "main" at the beginning of the exectable portion of
  12. **        the program.  Other compiler/linker packages may require
  13. **        that the program map be examine for the module that starts
  14. **        the program.
  15. */
  16. #include <dos.h>
  17. #include <stdio.h>
  18.  
  19. unsigned int
  20. main()
  21. {
  22.     FILE *fp;
  23.  
  24.     fp = fopen("pawhere.tmp", "w");
  25.     fprintf(fp, "%x %x\n",
  26.         (FP_SEG((char far *) main)), (FP_OFF((char far *) main)));
  27.     fclose(fp);
  28.     exit(0);
  29. }
  30.  
  31.